<?php
/**
 * Article
 * Класс Article отвечает за обработку статей
 * @author Sayp
 */
class Article extends ActiveRecord {
	protected static $_tableName = 'article';
	protected static $_pkName = 'ID_article';
	
	protected static $_essenceType = 4;
	
	protected $arrSettings = array(
		'created_at' => true
	);
	
	protected $arrWysiwyg = array('article_text' => 'article_text');
	
	protected $arrCheckboxes = array('is_main');
	
	protected function afterValidation() {
		if ($this->getField('ID_city') == -1) $this->setField('ID_city', null);
	}
}